// 商品分类controller
'use strict';
const { Controller } = require('egg');

class cProductClass extends Controller { 
  // pc
  // 查
  async pc_c_query () { 
    const { ctx } = this;
    const result = await ctx.service.sProductClass.pc_s_query(ctx?.query ?? {});
    ctx.body = result;
  }

  // 增
  async pc_c_create () { 
    console.log('?? - pc_c_create');
    const { ctx } = this;
    const result = await ctx.service.sProductClass.pc_s_create(ctx?.request?.body ?? {});
    ctx.body = result;
  }

  // 改
  async pc_c_update () { 
    console.log('?? - pc_c_update');
    const { ctx } = this;
    const result = await ctx.service.sProductClass.pc_s_update(ctx?.request?.body ?? {});
    ctx.body = result;
  }

  // 删
  async pc_c_delete () { 
    console.log('?? - pc_c_delete');
    const { ctx } = this;
    const result = await ctx.service.sProductClass.pc_s_delete(ctx?.query ?? {});
    ctx.body = result;
  }

  // 查询全部
  async pc_c_query_all () { 
    console.log('?? - pc_c_query_all');
    const { ctx } = this;
    const result = await ctx.service.sProductClass.pc_c_query_all();
    ctx.body = result;
  }

  // wa
  // 查
  async wa_c_query () { 
    console.log('?? - wa_c_query');
    const { ctx } = this;
    const result = await ctx.service.sProductClass.wa_s_query();
    ctx.body = result;
  }
}

module.exports = cProductClass;